import {request} from '@pkg/request/src';

export enum Api {
  oss = 'config/oss',
  ossSave = 'config/ossSave',
  pushSave = 'config/pushSave',
  sms = 'config/sms',
  get = 'config/get',
  smsSave = 'config/smsSave',
  saveIm = 'config/saveIm',
  getCommonConfig = 'config/getCommonConfig',
  commonConfigSave = 'config/commonConfigSave',
  globalConfigSave = 'config/globalConfigSave'
}


/**
 * 保存OSS配置
 * @param params
 * @param isUpdate
 */
export const saveOss = (params) => {
  return request.post({url: Api.ossSave, params});
};

/**
 * 保存推送配置
 * @param params
 */
export const savePush = (params) => {
  return request.post({url: Api.pushSave, params});
};

/**
 * 保存短信配置
 * @param params
 */
export const smsSave = (params) => {
  return request.post({url: Api.smsSave, params});
};

/**
 * 通讯配置
 * @param params
 */
export const saveIm = (params) => {
  return request.post({url: Api.saveIm, params});
};

/**
 * 通用配置保存
 * @param params
 */
export const saveCommon = (params) => {
  return request.post({url: Api.commonConfigSave, params});
};


/**
 * 加载oss配置
 * @param params
 */
export const getOssConfig = (params) => {
  return request.get({url: Api.oss, params});
};

/**
 * 加载公共配置
 * @param params
 */
export const getCommonConfig = (params) => {
  return request.get({url: Api.getCommonConfig, params});
};


/**
 * 加载系统配置
 * @param params
 */
export const getConfig = (params) => {
  return request.get({url: Api.get, params});
};

